package com.nuedu.corejava.ch7.homework;

import java.util.Scanner;

public class Gardener{
	public  Fruit create() {
		Fruit fruit=null;
		Scanner sanScanner=new Scanner(System.in);
		System.out.println("请输入一个水果");
		String name=sanScanner.nextLine();
		switch (name) {
		case "苹果":
			fruit= new Apple();
			break;
		case "香蕉":
			fruit=new Banana();
			break;
		case "葡萄":
			fruit=new Grape();
			break;
			default:
				break;

		}
		return fruit;
		
		
	}
	public static void main(String[] args) {
		Gardener g=new Gardener();
		g.create();
	}


	
}
